package com.usian.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usian.pojo.Auth;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AuthMapper extends BaseMapper<AuthMapper> {


    @Select("select a.* from t_auth a,t_role_auth h where a.id=h.auth_id and h.role_id in (\n" +
            "   select e.id from t_role e,t_user_role r where e.id=r.role_id and r.user_id =#{userId} \n" +
            ")")
    public List<Auth> findByUserId(@Param("userId") Integer userId);
}
